<template>
	<view>
		<view class="acea-row row-between row-middle menus">
			<view class="menus-item" v-for="(item,index) in menus" :key="index" @click="toModule(item,index)">
				<image :src="item.pic" mode=""></image>
				<view>{{item.name}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		name:'menuModule',
		props:{
			menus:{
				type:Array,
				default:()=>{
					return [{
					pic:'menu_01.png',
					name:'商铺'
				},
				{
					pic:'menu_02.png',
					name:'写字楼'
				},
				{
					pic:'menu_03.png',
					name:'厂房'
				},
				{
					pic:'menu_04.png',
					name:'仓库'
				},
				{
					pic:'menu_05.png',
					name:'土地'
				},
				{
					pic:'menu_06.png',
					name:'房屋'
				}]
				}
			}
		},
		watch:{
			menus(val){
				
			}
		},
		data(){
			return{
				
			}
		},
		/**
		 * 商铺883、写字楼884、仓库885、厂房911、土地912、房屋913、公寓1014
		 */
		methods:{
			toModule(item,index){
				let m = []
				this.menus.forEach((item,index)=>{
					let obj = {}
					obj['name'] = item.name
					switch(item.name){
						case '商铺':
							obj['type'] = 883;
							break;
						case '写字楼':
							obj['type'] = 884;
							break;
						case '仓库':
							obj['type'] = 885;
							break;
						case '厂房':
							obj['type'] = 911;
							break;
						case '土地':
							obj['type'] = 912;
							break;
						case '房屋':
							obj['type'] = 913;
							break;
						case '公寓':
							obj['type'] = 1014;
							break;
						default:
								obj['type'] = -1;
					}
					m.push(obj)
				})
				let url = '/pages/others/shopAreaList/shopAreaList?index='+(index+1)+'&m='+JSON.stringify(m);
				// if(index!=0) url = '/pages/details/offeraRreward/offeraRreward';
				// '/pages/others/shopAreaList/shopAreaList?index='+index
				uni.navigateTo({
					url
				})
			}
		}
	}
</script>

<style lang="scss">
	.menus{
		margin-bottom: 36rpx;
		.menus-item{
			font-size: 22rpx;
			color: rgba(51, 51, 51, 1);
			text-align: center;
			view{
				padding: 30rpx 0;
			}
			image{
				display: block;
				margin: 0;
				width: 80rpx;
				height: 80rpx;
			}
		}
		.menuss-item~.menus-item{
			margin-left: 30rpx;
		}
	}
</style>